home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / RexxScripts.lha / Rexx / TurboText / CRevision.ttx < prev    next >
Text File  |  1993-06-14  |  1KB  |  60 lines

  1. /*
  2.     Revises a `C' source code
  3.     The default Port of KCommodity is assumed to be KComm.1.
  4.     This script was written for CygnusED II Pro, but I think it can
  5.      be easily ported to other editors having an ARexx-Port.
  6.  
  7.     Written by : Kai Iske
  8.              Brucknerstrasse 18
  9.              6450 Hanau 1
  10.              GERMANY
  11.              Tel.: +49-(0)6181-850181
  12.  
  13.     THIS SCRIPT IS PUBLIC DOMAIN
  14.  
  15.     Modified for use with TurboText by Joachim Worringen 10.01.93
  16.     FIDO:    2:242/7.3
  17.     E-Mail:  Joachim_Worringen@mowgli.fido.de
  18.  
  19.     The cursorpositioning looks a little bit complicated, but the
  20.     "Bookmark"-funtion couldn`t be used in this case since TurboText
  21.     forgets all the old bookmarks if you load a new file (exactly what
  22.     happens here) so I had to choose this method.
  23. */
  24.  
  25. OPTIONS RESULTS
  26.  
  27. GetFileInfo
  28. parse var RESULT lines_old ' ' modified ' ' name
  29.  
  30. if name = "" then
  31. do
  32.     SetStatusBar "No file name -- aborting"
  33.     exit 0
  34. end
  35. IF modified = YES THEN SaveFile
  36.  
  37. GetCursorPos
  38. parse var RESULT line . .
  39.  
  40. GetFilePath
  41. RevName = RESULT
  42.  
  43. ADDRESS 'KComm.1' REVISE RevName C
  44. RevDone = RESULT
  45.  
  46. Screen2Front
  47.  
  48. IF RevDone = 1 THEN
  49. DO
  50.     OpenFile RevName
  51.     GetFileInfo
  52.     parse var RESULT lines_new . .
  53.     Move line + lines_new - lines_old
  54.     CenterView
  55. END
  56. ELSE
  57.     SetStatusBar "Error on revising !"
  58. exit
  59.  
  60.